/*  File Name	: EventHandler.cpp
 *  Author		: Javie Pong
 *	 E-mail		: 823960168@qq.com
 *  Created on	: 2012-3-20
 *  Description:
 */

#include "EventHandler.h"
#include "ProcessManager.h"

EventHandler::EventHandler()
{
	this->reactor_ = NULL;
}

EventHandler::~EventHandler()
{

}

void EventHandler::reactor(Reactor *reactor)
{
	if(NULL!=reactor)
	{
		this->reactor_ = reactor;
	}
}

Reactor *EventHandler::reactor(void) const
{
	return this->reactor_;
}

int EventHandler::handle_input(int handle)
{
	LOG((DEBUG_LOG,"EventHandler::handle_input:[%d]",handle));
	return -1;
}

int EventHandler::handle_output(int handle)
{
	return 0;
}

int EventHandler::handle_exception(int handle)
{
	return 0;
}

int EventHandler::handle_signal(int signum)
{
	LOG((DEBUG_LOG,"EventHandler::handle_signal:[%d]",signum));
	return 0;
}

int EventHandler::handle_timeout(void)
{
	LOG((DEBUG_LOG,"EventHandler::handle_timeout"));
	return 0;
}

int EventHandler::handle_close(int handle,ReactorMask mask)
{
	LOG((DEBUG_LOG,"EventHandler::handle_close"));
	return 0;
}

int EventHandler::handle_exit(int pid)
{
	LOG((DEBUG_LOG,"EventHandler::handle_exit:[%d]",pid));
	return 0;
}
